<template>
  <div class="common-layout">
    <el-container class="content-container">
      <el-header style="padding: 0px;">
        <HeaderNav></HeaderNav>
      </el-header>
      <el-container>
        <el-aside style="width: 64px">
          <SiderNav></SiderNav>
        </el-aside>
        <el-container>
          <el-main>
            <router-view></router-view>
          </el-main>
        </el-container>
      </el-container>
    </el-container>
    <el-footer class="fixed-footer">
      <FooterBar></FooterBar>
    </el-footer>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import HeaderNav from './components/HeaderNav.vue'
import SiderNav from './components/SiderNav.vue'
import FooterBar from './components/FooterBar.vue'

import ApiClient from './api/ApiClient'

export default defineComponent({
  name: 'App',
  components: {
    HeaderNav,
    SiderNav,
    FooterBar,
  },
  mounted(): void {
    console.log('BlockDAO Loaded');
    ApiClient.checkStatus();
  },
})
</script>

<style scoped>

.common-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* 确保容器至少占满整个视口高度 */
}

.content-container {
  flex-grow: 1; /* 让内容区域占据剩余的空间 */
}

.fixed-footer {
  position: sticky;
  bottom: 0;
  width: 100%;
}
</style>